import React from 'react';
import styles from './TodoFilterItem.css';
function getClassName(cutFilter,spanFilter) {
  if(cutFilter===spanFilter){
    return styles.cur
  }else {return styles.normal}
}
function TodoFilterItem(B) {
  // console.log(props.filter)
  return (
    <span onClick={()=>{
      B.dispatch({type:'todos/filter',filter:B.filter})
    }} className={getClassName(B.todos.filter,B.filter)}>
      {B.children}
    </span>
  );
}

export default TodoFilterItem;
